package com.moleq.models;

import com.moleq.db.DatabaseSchema;


public class TareSetting {
//	CREATE TABLE t_tare_setting
//	(ta_no INTEGER NOT NULL,
//	ta_desc varchar(30) NULL,
//	ta_value integer Default 0 NOT NULL,
//	create_datetime varchar(14) NOT NULL,
//	update_datetime varchar(14) NOT NULL,
//	PRIMARY KEY (ta_no));
	
	private int ta_no; 
	private String ta_desc = ""; 
	private int ta_value; 
	private String create_datetime;
	private String update_datetime;
	
    private int qty;
    private String type;
	private double totalTare;
	private boolean isEdit = false;
	private int no;
	public int getNo() {
		return no;
	}
	public void setNo(int no) {
		this.no = no;
	}
	public TareSetting(){}
	public TareSetting(int _ta_no,String _ta_desc,int _ta_value,
			int _qty,String create_datetime,String update_datetime){
		this.ta_no = _ta_no;
		this.ta_desc = _ta_desc;
		this.ta_value = _ta_value;
		this.qty = _qty;
		this.create_datetime = create_datetime;
		this.update_datetime = update_datetime;
	}
	
	public int getQty() {
		return qty;
	}
	public void setQty(int qty) {
		this.qty = qty;
	}
	
	public int getTa_no() {
		return ta_no;
	}
	public void setTa_no(int ta_no) {
		this.ta_no = ta_no;
	}
	public String getTa_desc() {
		return ta_desc;
	}
	public void setTa_desc(String ta_desc) {
		this.ta_desc = ta_desc;
	}
	public int getTa_value() {
		return ta_value;
	}
	public void setTa_value(int ta_value) {
		this.ta_value = ta_value;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public double getTotalTare() {
		return totalTare;
	}
	public void setTotalTare(double totalTare) {
		this.totalTare = totalTare;
	}
	public String getCreate_datetime() {
		return create_datetime;
	}
	public void setCreate_datetime(String create_datetime) {
		this.create_datetime = create_datetime;
	}
	public String getUpdate_datetime() {
		return update_datetime;
	}
	public void setUpdate_datetime(String update_datetime) {
		this.update_datetime = update_datetime;
	}
	public boolean isEdit() {
		return isEdit;
	}
	public void setEdit(boolean isEdit) {
		this.isEdit = isEdit;
	}
	
	public String toMGData(String Action) {
		String Result = Action + "|" + DatabaseSchema.TareSetting.SCHEMA_NAME
				+ "|(" + getTa_no() + "," + CheckNull(getTa_desc()) + "," + getTa_value() 
				+ "," + CheckNull(getCreate_datetime()) + "," + CheckNull(getUpdate_datetime()) + ")";
		return Result;
	}
	
	public String CheckNull(String value){
		if(value == null){
			return null;
		}else{
			return "'" + value + "'";
		}
	}
}
